package com.smile.weather2.network.api;

import com.smile.weather2.url.Urls;

import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

/**
 * 网络请求接口
 * Created by smile on 2016/8/26.
 */
public interface NetWorkApi {

    /**
     * 查询城市信息接口
     * @param which (allchina表示国内城市, allattractions表示国内景点)
     * @return
     */
    @GET(Urls.ALLCHINA_URL)
    Observable<Response<String>> queryCity(@Query("search") String which);

    /**
     * 查询天气信息接口
     * @param path (weather表示通过城市id查， attractions表示通过景点id查)
     * @param cityid (城市或景点的id)
     * @return
     */
    @GET(Urls.WEATHER_URL)
    Observable<Response<String>> queryWeather(@Path("path") String path,
                                              @Query("cityid") String cityid);
}
